<template>
  <van-popup v-model:show="show" position="bottom" :before-close="handleClose" :style="{ height: '50%' }">
    <div class="contaier">
      <div class="title">31类重点人群有那些?</div>
      <div class="group" v-for="group in ThirtyOne">
        <div class="group-title">{{ group.text }}</div>
        <div class="item" v-for="item in group.children">
          <div class="item-title">{{ item.text }}</div>
        </div>
      </div>
    </div>
  </van-popup>
</template>
<script setup>
import ThirtyOne from '@/data/31.json'

const emit = defineEmits(['update:show'])
const props = defineProps({
  show: { type: Boolean, default: false },
})

const show = computed({
  get: () => props.show,
  set: val => emits('update:show', val),
})

const handleClose = () => emit('update:show', false)
</script>
<style lang="scss" scoped>
.contaier {
  padding: 20px;
  .title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
  }
  .group {
    margin-bottom: 20px;
  }
  .group-title {
    font-size: 16px;
    margin-bottom: 5px;
  }
  .item-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
  }
}
</style>
